package com.example.orderconsumer.config;

import com.example.orderconsumer.service.InventoryService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class InventoryServiceFallbackFactory implements FallbackFactory<InventoryService> {
    @Override
    public InventoryService create(Throwable cause) {
        return new InventoryService() {
            @Override
            public Boolean lockStock(Long productId, Integer quantity) {
                return false;
            }
            @Override
            public Boolean releaseStock(Long productId, Integer quantity) {
                return false;
            }
        };
    }
}